constructor() {
this._shellwm = global.window_manager;
- this._minimizing = [];
- this._unminimizing = [];
- this._mapping = [];
- this._resizing = [];
- this._destroying = [];
+ this._minimizing = new Set();
+ this._unminimizing = new Set();
+ this._mapping = new Set();
+ this._resizing = new Set();
+ this._destroying = new Set();
this._movingWindow = null;
this._dimmedWindows = [];
- this._skippedActors = [];
+ this._skippedActors = new Set();
this._allowedKeybindings = {};
}
skipNextEffect(actor) {
- this._skippedActors.push(actor);
+ this._skippedActors.add(actor);
}
setCustomKeybindingHandler(name, modes, handler) {
}
_shouldAnimateActor(actor, types) {
- if (this._removeEffect(this._skippedActors, actor))
+ if (this._skippedActors.delete(actor))
return false;
if (!this._shouldAnimate())
return types.includes(type);
}
- _removeEffect(list, actor) {
- let idx = list.indexOf(actor);
- if (idx != -1) {
- list.splice(idx, 1);
- return true;
- }
- return false;
- }
-
_minimizeWindow(shellwm, actor) {
let types = [Meta.WindowType.NORMAL,
Meta.WindowType.MODAL_DIALOG,
actor.set_scale(1.0, 1.0);
- this._minimizing.push(actor);
+ this._minimizing.add(actor);
if (actor.meta_window.is_monitor_sized()) {
actor.ease({
}
_minimizeWindowDone(shellwm, actor) {
- if (this._removeEffect(this._minimizing, actor)) {
+ if (this._minimizing.delete(actor)) {
actor.remove_all_transitions();
actor.set_scale(1.0, 1.0);
actor.set_opacity(255);
return;
}
- this._unminimizing.push(actor);
+ this._unminimizing.add(actor);
if (actor.meta_window.is_monitor_sized()) {
actor.opacity = 0;
}
_unminimizeWindowDone(shellwm, actor) {
- if (this._removeEffect(this._unminimizing, actor)) {
+ if (this._unminimizing.delete(actor)) {
actor.remove_all_transitions();
actor.set_scale(1.0, 1.0);
actor.set_opacity(255);
_sizeChangedWindow(shellwm, actor) {
if (!actor.__animationInfo)
return;
- if (this._resizing.includes(actor))
+ if (this._resizing.has(actor))
return;
let actorClone = actor.__animationInfo.clone;
let scaleX = targetRect.width / sourceRect.width;
let scaleY = targetRect.height / sourceRect.height;
- this._resizing.push(actor);
+ this._resizing.add(actor);
// Now scale and fade out the clone
actorClone.ease({
}
_sizeChangeWindowDone(shellwm, actor) {
- if (this._removeEffect(this._resizing, actor)) {
+ if (this._resizing.delete(actor)) {
actor.remove_all_transitions();
actor.scale_x = 1.0;
actor.scale_y = 1.0;
actor.scale_y = 0.05;
actor.opacity = 0;
actor.show();
- this._mapping.push(actor);
+ this._mapping.add(actor);
actor.ease({
opacity: 255,
actor.scale_y = 0;
actor.opacity = 0;
actor.show();
- this._mapping.push(actor);
+ this._mapping.add(actor);
actor.ease({
opacity: 255,
}
_mapWindowDone(shellwm, actor) {
- if (this._removeEffect(this._mapping, actor)) {
+ if (this._mapping.delete(actor)) {
actor.remove_all_transitions();
actor.opacity = 255;
actor.set_pivot_point(0, 0);
switch (actor.meta_window.window_type) {
case Meta.WindowType.NORMAL:
actor.set_pivot_point(0.5, 0.5);
- this._destroying.push(actor);
+ this._destroying.add(actor);
actor.ease({
opacity: 0,
case Meta.WindowType.MODAL_DIALOG:
case Meta.WindowType.DIALOG:
actor.set_pivot_point(0.5, 0.5);
- this._destroying.push(actor);
+ this._destroying.add(actor);
if (window.is_attached_dialog()) {
let parent = window.get_transient_for();
}
_destroyWindowDone(shellwm, actor) {
- if (this._removeEffect(this._destroying, actor)) {
+ if (this._destroying.delete(actor)) {
let parent = actor.get_meta_window().get_transient_for();
if (parent && actor._parentDestroyId) {
parent.disconnect(actor._parentDestroyId);